package main

import (
	"fmt"
	"strconv"
	"time"
)

var globalChan chan int

func main() {

	// channelTest()
}

func channelTest() {
	strChan := make(chan string)
	defer close(strChan)

	go func() {
		for i := 0; i < 10; i++ {
			time.Sleep(1 * time.Second)
			strChan <- "this is router chan input >>>> " + strconv.Itoa(i)
		}
		strChan <- "end"
	}()

	for {
		select {
		case value := <-strChan:
			fmt.Println(value)
		}
	}
}

func channelTest2() {
	for {
		select {
		case <-time.After(10 * time.Second):
			fmt.Println("time is done >>>>")
		case <-globalChan:

		}
	}

}
